import sys
import os
import re

# db
# 连接的是postgresql数据库
DB_CONF = {
    'host': 'master',
    'port': 5432,
    'user': 'root',
    'password': 'root',
    'database': 'firmware'
}


# log
LOG_STREAM = sys.stderr
LOG_LEVEL = 'INFO'
LOG_FMT = '%(asctime)s [%(levelname)s] %(message)s'
LOG_DATE_FMT = '%Y-%m-%d %H:%M:%S'


# downloader.py
REQ_CONNECT_TIMEOUT = 30
DOWNLOAD_TIMEOUT = 30
DOWNLOAD_DIR = os.path.join(os.path.abspath('.'), 'firmwares')
FILENAME_FETCHER_PATTERN = re.compile('filename="(.+)"')
